LibGDX Cross-Platform Development Blueprints by Unknown
Author:Unknown
Language: eng
Format: epub
Publisher: Packt Publishing
Then, edit the corresponding line in GameScreen:
Gdx.input.setInputProcessor(new InputManager(camera)); // enable InputManager to receive input events
We will override the onTouchUp() and onTouchDown()callback methods in InputManager. The onTouchDown() method is called when the user touches the screen. The onTouchUp() method is called when the user lifts their finger from the screen:
@Override public boolean touchDown(int screenX, int screenY, int pointer, int button) { temp.set(screenX,screenY, 0); //get the touch co-ordinates with respect to the camera's viewport camera.unproject(temp); float touchX = temp.x; float touchY = temp.y; if(isLeftPaddleTouched(touchX,touchY)){ GameManager.bob.setLeftPaddleTouched(true); } else if(isRightPaddleTouched(touchX,touchY)){ GameManager.bob.setRightPaddleTouched(true); } return false; } @Override public boolean touchUp(int screenX, int screenY, int pointer, int button) { temp.set(screenX,screenY, 0); //get the touch co-ordinates with respect to the camera's viewport camera.unproject(temp); float touchX = temp.x; float touchY = temp.y; if(isLeftPaddleTouched(touchX,touchY)){ GameManager.bob.setLeftPaddleTouched(false); } else if(isRightPaddleTouched(touchX,touchY)){ GameManager.bob.setRightPaddleTouched(false); } return false; }
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Ajax | Assembly Language Programming |
Borland Delphi | C & C++ |
C# | CSS |
Compiler Design | Compilers |
DHTML | Debugging |
Delphi | Fortran |
Java | Lisp |
Perl | Prolog |
Python | RPG |
Ruby | Swift |
Visual Basic | XHTML |
XML | XSL |
Deep Learning with Python by François Chollet(12272)
Hello! Python by Anthony Briggs(9650)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9573)
The Mikado Method by Ola Ellnestam Daniel Brolund(9549)
Dependency Injection in .NET by Mark Seemann(9083)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8075)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7595)
Grails in Action by Glen Smith Peter Ledbrook(7506)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7323)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6221)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(5432)
Microservices with Go by Alexander Shuiskov(5157)
Practical Design Patterns for Java Developers by Miroslav Wengner(5073)
Test Automation Engineering Handbook by Manikandan Sambamurthy(5060)
Kotlin in Action by Dmitry Jemerov(4862)
Angular Projects - Third Edition by Aristeidis Bampakos(4402)
The Art of Crafting User Stories by The Art of Crafting User Stories(3954)
NetSuite for Consultants - Second Edition by Peter Ries(3940)
Practical Vim (for Kathryn Amaral) by Drew Neil(3851)